/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.hycreate.platform.modules.crm.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hycreate.platform.common.persistence.Page;
import com.hycreate.platform.common.service.CrudService;

/**
 * 字典取行业等Service
 * @author zyc
 * @version 2016-12-03
 */
@Service
@Transactional(readOnly = true)
public class SysDictService extends CrudService<SysDictDao, CrmSysDict> {
	
	@Autowired
	private SysDictDao sysDictDao;

	public CrmSysDict get(String id) {
		return super.get(id);
	}
	
	public List<CrmSysDict> findList(CrmSysDict sysDict) {
		return super.findList(sysDict);
	}
	
	public Page<CrmSysDict> findPage(Page<CrmSysDict> page, CrmSysDict sysDict) {
		return super.findPage(page, sysDict);
	}
	
	@Transactional(readOnly = false)
	public void save(CrmSysDict sysDict) {
		super.save(sysDict);
	}
	
	@Transactional(readOnly = false)
	public void delete(CrmSysDict sysDict) {
		super.delete(sysDict);
	}
	
	/**
	 * 从字典中查询所有行业名
	 * */
	public List<String> findAllIndustryNames() {
		return sysDictDao.findAllIndustryNames();
	}
	
	/**
	 * 根据客户从字典表中取出所有相关行业
	 * */
	public List<CrmSysDict> findIndustryNameByCustomer(String customerId) {
		return sysDictDao.findIndustryNameByCustomer(customerId);
	}

	public List<CrmSysDict> finAllIndustry() {
		return sysDictDao.finAllIndustry();
	}

	
	
}